<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增分销商等级')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-level-add">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">[[#{levelName}]]：</label>
                    <div class="col-sm-8">
                        <input name="levelName" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">[[#{level}]]：</label>
                    <div class="col-sm-8">
                        <input name="levelValue" class="form-control" type="number" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">[[#{orderAmount}]]：</label>
                    <div class="col-sm-8">
                        <input name="orderAmount" class="form-control" type="number">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">[[#{orderQuantity}]]：</label>
                    <div class="col-sm-8">
                        <input name="orderCount" class="form-control" type="number">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">[[#{percentage}]](%)：</label>
                    <div class="col-sm-8">
                        <input name="commissionRate" class="form-control" type="number" min="1" max="100" placeholder="(%)" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">[[#{remark}]]：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "business/distributor/level"
        $("#form-level-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-level-add').serialize());
            }
        }
    </script>
</body>
</html>